first column one is the parameter type,//Here we use the default parameter type cell Ncell=nrow.createcell (2);//Fifth: Set the contents of the cell ncell.setcellvalue ("technical Department bonus");//Sixth step: Save OutputStream os=new FileOutputStream (New File ("F:\\testpoi.xls")); wb.write (OS);//Seventh step: Close Os.close ();}}We tested this method, and after we ran it, we found this file on the F-disk.And then open it, and find the content e
Getting started with POI
POI Quick Start
Seven steps required for POI development:
1. Create a WorkBook object
Workbook wb = new HSSFWorkbook (); // It is used to operate excel 2003
2. Create a worksheet Sheet object
Sheet sheet = wb. createSheet ();
3. Create a row object
Row nRow = sheet. createRow (number of rows );
4. Create a Cell Object
Cell nCell = nRow. createCell (number of columns );
5. Write content
N
Label:Need to enter under Vsql: Import: Copy emp from '/tmp/emp.csv ' DELIMITER ', ' ESCAPE as ' \ ' enclosed by ' "' DIRECT EXCEPTIONS '/log file path/log filename. log 'Directly on the server command line where the Vertica is located:vsql-d db Instance-u user name-w password-c "copy corresponding database table from ' file name ' DELIMITER ', '" DIRECT EXCEPTIONS '/log file path/log filename. log '; Such as: vsql-d ncell-u dbadmin-w 1-c "copy emp fr
. get_Range ("C1", Missing. Value );
If (range1 = null ){
Console. WriteLine ("ERROR: range = null ");
}
Const int nCells = 1;
Object [] args1 = new Object [1];
Args1 [0] = nCells;
Range1.GetType (). InvokeMember ("Value", BindingFlags. SetProperty, null, range1, args1 );
Return 100;
}
}
Now let's take a look at how to use arrays, which are similar to setting cells. The only change required is args2 [0] = array2;Const int nCell = 5;
Range range2 = wor
stream it can only operate the excel2003 version 2. Reading sheet Sheet Sheet = wb.getsheetat (0);
0 represents the subscript of the worksheet//extracts some common variables Row nrow=null;
Cell NCell = null; int rowno=0;//line number int cellno=1;//column number//3. Create Row Objects//========================================== the production of large headings nrow = Sheet.getrow (rowno++); Read Row Object
Workbook");//Set the workbook name//step 3: Create a Row object Hssfrow nrow = Sheet.createrow ( (short) 1);//Line 2nd//step 4: Specify column to create Cell object Hssfcell NCell = Nrow.createcell ((short) (2));3rd Column//step 5: Specify the column to create the Cell object Ncell.setcellvalue ("I am a Cell"),//step 6: Set the style Ncell.setcellstyle (Leftstyle (WB));//step 7: Close the Save Excel file FileOutputStream FOut = new FileOutputStream (
. getat (J-1 ));}Else{Printf ("% s/n", rows. getat (J-1 ));}}}// Print out total number of ColumnsPrintf ("/ntotal Number of columns = % d/n", ss. gettotalcolumns ());
// Read and print out contents of second column of SpreadsheetSS. readcolumn (column, 2 );For (I = 0; I {Printf ("column 2 row % d: % s/n", I + 1, column. getat (I ));}// Read in and print out the cell value at column 3, Row 3 of SpreadsheetIf (ss. readcell (tempstring, 3, 3 )){Printf ("/ncell
POI Quick StartSeven steps required for POI development:1. Create a workbook Workbook objectWorkbook wb = new Hssfworkbook (); // It is the operation of the Excel 2003 version
2. Create a worksheet Sheet objectSheet Sheet = Wb.createsheet ();3. Create a Row objectRow Nrow = sheet.createrow (number of rows);4. Create a Cell objectCell NCell = Nrow.createcell (number of columns);5. Write contentNcell.setcellvalue (the content to write );6.
Contact Us
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.